package dubbo

import (
	"context"
	"fmt"
	_ "github.com/apache/dubbo-go-hessian2"
	_ "github.com/apache/dubbo-go/cluster/cluster_impl"
	_ "github.com/apache/dubbo-go/cluster/loadbalance"
	_ "github.com/apache/dubbo-go/common/proxy/proxy_factory"
	"github.com/apache/dubbo-go/config"
	_ "github.com/apache/dubbo-go/filter/filter_impl"
	_ "github.com/apache/dubbo-go/protocol/dubbo"
	_ "github.com/apache/dubbo-go/registry/protocol"
	_ "github.com/apache/dubbo-go/registry/zookeeper"
)

type HelloWorldService struct {
	Add func(ctx context.Context, req []interface{}, rsp *int) error
}

var helloWorldService = new(HelloWorldService)

func (u *HelloWorldService) Reference() string {
	return "helloworld"
}

func init() {
	config.SetConsumerService(helloWorldService)
}

var x = 10

func Test() {

	config.Load()

	helloWorldService.Add(context.TODO(), []interface{}{1, 2}, &x)

	fmt.Println(x)
}
